#ifndef PLAYER_H
#define PLAYER_H

#include<QObject>

class SimplePlayer;
class Playlist;
class QTimer;

#define STATE_CHECK_TIMER	5000

class Player: public QObject{
	Q_OBJECT
public:
	enum DesiredState{
		Playing,
		Paused,
		Stopped
	};

	Player(QObject *parent);
	~Player();

	//I do not like this too much ...
	Playlist *playlist()const{ return m_playlist; }
public slots:
	//void play(int seqNo);
	void play();
	void pause();
	void stop();
	void next();
	void prev();
private slots:
	void slotPlayerFinished(short attempts = 5);
	void slotStateTimerTimeout();
signals:
	void playing();
	void stopped();
	void paused();
private:
	SimplePlayer *m_simplePlayer;
	Playlist *m_playlist;
	DesiredState m_desiredState;

	QTimer *m_stateTimer;
};

#endif // PLAYER_H
